home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / gccdif~1.z / gccdif~1 / gcc-1.36.diff < prev    next >
Encoding:
Text File  |  1989-09-30  |  40.6 KB  |  1,672 lines

  1. *** ../../../Gnu/gcc-1.36/cccp.c    Mon Sep 11 23:43:13 1989
  2. --- cccp.c    Sat Sep 30 20:51:53 1989
  3. ***************
  4. *** 23,28 ****
  5. --- 23,30 ----
  6.   
  7.   typedef unsigned char U_CHAR;
  8.   
  9. + #ifndef atarist
  10.   #ifdef EMACS
  11.   #define NO_SHORTNAMES
  12.   #include "../src/config.h"
  13. ***************
  14. *** 50,66 ****
  15.   
  16.   #ifndef VMS
  17.   #include <sys/file.h>
  18. ! #ifndef USG
  19.   #include <sys/time.h>        /* for __DATE__ and __TIME__ */
  20.   #include <sys/resource.h>
  21.   #else
  22.   #define index strchr
  23.   #define rindex strrchr
  24.   #include <time.h>
  25.   #include <fcntl.h>
  26. ! #endif /* USG */
  27.   #endif /* not VMS */
  28. !   
  29.   /* VMS-specific definitions */
  30.   #ifdef VMS
  31.   #include <time.h>
  32. --- 52,86 ----
  33.   
  34.   #ifndef VMS
  35.   #include <sys/file.h>
  36. ! #if (!(defined(USG) || defined(atariminix)))
  37.   #include <sys/time.h>        /* for __DATE__ and __TIME__ */
  38.   #include <sys/resource.h>
  39.   #else
  40. + #ifndef atariminix
  41.   #define index strchr
  42.   #define rindex strrchr
  43. + #endif
  44.   #include <time.h>
  45.   #include <fcntl.h>
  46. ! #endif /* USG or atariminix */
  47.   #endif /* not VMS */
  48. ! #else        /* atarist */
  49. ! #include <ctype.h>
  50. ! #include <stdio.h>
  51. ! #include <types.h>
  52. ! #include <stat.h>
  53. ! #include <file.h>
  54. ! #include <time.h>
  55. ! #include "stddef.h"
  56. ! extern long _stksize = 524288;    /* want big stack cause include files
  57. !                    get alloca'ed there */
  58. ! #endif        /* atarist */
  59. !  
  60.   /* VMS-specific definitions */
  61.   #ifdef VMS
  62.   #include <time.h>
  63. ***************
  64. *** 249,268 ****
  65. --- 269,327 ----
  66.   /* #include "file" looks in source file dir, then stack. */
  67.   /* #include <file> just looks in the stack. */
  68.   /* -I directories are added to the end, then the defaults are added. */
  69. + #ifdef atarist
  70. + struct file_name_list include_canned_defaults[] =
  71. +   {
  72. +     { &include_canned_defaults[1], "\\gnu\\lib" },
  73. +     { 0, "\\gnu\\include" }
  74. +   };
  75. + struct file_name_list * include_defaults = &include_canned_defaults[0];
  76. + #else
  77.   struct file_name_list include_defaults[] =
  78.     {
  79.   #ifndef VMS
  80. + #ifdef CROSSATARI
  81. +     { 0, CROSSINC }
  82. + #else
  83. + #ifdef atariminix
  84. +     { 0, "/usr/local/gcc-include" }
  85. + #else
  86.       { &include_defaults[1], GCC_INCLUDE_DIR },
  87.       { &include_defaults[2], "/usr/include" },
  88.       { 0, "/usr/local/include" }
  89. + #endif
  90. + #endif
  91.   #else
  92.       { &include_defaults[1], "GNU_CC_INCLUDE:" },       /* GNU includes */
  93.       { &include_defaults[2], "SYS$SYSROOT:[SYSLIB.]" }, /* VAX-11 "C" includes */
  94.       { 0, "" },    /* This makes normal VMS filespecs work OK */
  95.   #endif /* VMS */
  96.     };
  97. + #endif /* atarist */
  98.   
  99.   /* These are used instead of the above, for C++.  */
  100. + #ifdef atarist
  101. + struct file_name_list include_canned_cplusplus_defaults[] =
  102. +   {
  103. +     { &include_canned_defaults[1], "\\gnu\\lib" },
  104. +     { 0, "\\gnu\\include" }
  105. +   };
  106. + struct file_name_list * cplusplus_include_defaults =
  107. +                     &include_canned_cplusplus_defaults[0];
  108. + #else
  109. + #ifdef atariminix
  110. + #define GPLUSPLUS_INCLUDE_DIR "/usr/local/g++-include"
  111. + #define GCC_INCLUDE_DIR "/usr/local/gcc-include"
  112. + #endif
  113.   struct file_name_list cplusplus_include_defaults[] =
  114.     {
  115.   #ifndef VMS
  116. ***************
  117. *** 270,276 ****
  118. --- 329,339 ----
  119.       { &cplusplus_include_defaults[1], GPLUSPLUS_INCLUDE_DIR },
  120.       /* Use GNU CC specific header files.  */
  121.       { &cplusplus_include_defaults[2], GCC_INCLUDE_DIR },
  122. + #ifdef CROSSATARI
  123. +     { 0, CROSSINC }
  124. + #else
  125.       { 0, "/usr/include" }
  126. + #endif
  127.   #else
  128.       { &cplusplus_include_defaults[1], "GNU_GXX_INCLUDE:" },
  129.       { &cplusplus_include_defaults[2], "GNU_CC_INCLUDE:" },
  130. ***************
  131. *** 279,284 ****
  132. --- 342,348 ----
  133.       { 0, "" },    /* This makes normal VMS filespecs work OK */
  134.   #endif /* VMS */
  135.     };
  136. + #endif /* atarist */
  137.   
  138.   struct file_name_list *include = 0;    /* First dir to search */
  139.       /* First dir to search for <file> */
  140. ***************
  141. *** 507,513 ****
  142. --- 571,631 ----
  143.   /* Nonzero means -I- has been seen,
  144.      so don't look for #include "foo" the source-file directory.  */
  145.   int ignore_srcdir;
  146. +  
  147. + #ifdef atarist
  148. + /* a little frobule to filter incoming file data */
  149. + int eunuchs_read(f, buf, size)
  150. + int f;
  151. + char * buf;
  152. + int size;
  153. + {
  154. +   char local_buf[1024];
  155. +   register int result_size;
  156. +   register char * local_bufp, * target_bufp;
  157. +   register int buf_size, size_read;
  158. +   for (result_size = 0, target_bufp = buf ; size > 0 ; size -= 1024)
  159. + /* do a buffer */
  160. +       {
  161. +     if (size > 1024)
  162. +         buf_size = 1024;
  163. +         else
  164. +             buf_size = size;
  165. +     size_read = read(f, &local_buf, buf_size);
  166. +     for (local_bufp = (char * ) &local_buf; size_read > 0 ; size_read--)
  167. +         if (*local_bufp == '\r')
  168. +             local_bufp++;
  169. +             else
  170. +                 {
  171. +             *target_bufp++ = *local_bufp++;
  172. +             result_size++;
  173. +             }
  174. +     }
  175. +   return(result_size);
  176. + }
  177. + /* the following dingus is used in place of some calls to bcopy,
  178. +    to ensure that backslashes get properly slashified when getting
  179. +    shoved into strings.  Note that it returns the new pointer!!
  180. +    There ought to be a better way... */
  181. + U_CHAR * slashifying_bcopy(from_buf, to_buf, nbytes)
  182. + U_CHAR * from_buf, * to_buf;
  183. + int nbytes;
  184. + {
  185. +   for ( ; nbytes > 0 ; )
  186. +     {
  187. +     if(*from_buf == '\\')
  188. +         *to_buf++ = '\\';
  189. +     *to_buf++ = *from_buf++;
  190. +     nbytes--;
  191. +     }
  192. +   return(to_buf);
  193. + }
  194. + #endif        /* atarist */
  195.   
  196. + #ifndef atarist
  197.   /* Handler for SIGPIPE.  */
  198.   
  199.   static void
  200. ***************
  201. *** 515,520 ****
  202. --- 633,639 ----
  203.   {
  204.     fatal ("output pipe has been closed");
  205.   }
  206. + #endif
  207.   
  208.   int
  209.   main (argc, argv)
  210. ***************
  211. *** 540,545 ****
  212. --- 659,669 ----
  213.     /* Target-name to write with the dependency information.  */
  214.     char *deps_target = 0;
  215.   
  216. + #ifdef atarist
  217. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  218. + /*  _malloczero(1); */     /* zero mallocs by default */
  219. + #endif  
  220.   #ifdef RLIMIT_STACK
  221.     /* Get rid of any avoidable limit on stack size.  */
  222.     {
  223. ***************
  224. *** 588,600 ****
  225. --- 712,730 ----
  226.     cplusplus = 1;
  227.   #endif
  228.   
  229. + #ifndef atarist
  230.     signal (SIGPIPE, pipe_closed);
  231. + #endif  
  232.   
  233.   #ifndef VMS
  234.     max_include_len
  235. + #ifdef atarist
  236. +     =    sizeof ("/usr/include/CC");
  237. + #else
  238.       = max (max (sizeof (GCC_INCLUDE_DIR),
  239.           sizeof (GPLUSPLUS_INCLUDE_DIR)),
  240.          sizeof ("/usr/include/CC"));
  241. + #endif
  242.   #else /* VMS */
  243.     max_include_len
  244.       = sizeof("SYS$SYSROOT:[SYSLIB.]");
  245. ***************
  246. *** 604,609 ****
  247. --- 734,759 ----
  248.     bzero (pend_defs, argc * sizeof (char *));
  249.     bzero (pend_undefs, argc * sizeof (char *));
  250.   
  251. + #ifdef atarist
  252. + /* see if we have an indication of where the GNU library directory is */
  253. +   {
  254. +     char * gnulib = (char * ) getenv("GNUINC");
  255. +     struct file_name_list * gnulib_dir;
  256. +     if(!gnulib) gnulib = (char *) getenv("GNULIB"); /* try GNULIB */
  257. +     if (gnulib)
  258. +     {
  259. +     gnulib_dir = (struct file_name_list * ) 
  260. +         xmalloc(sizeof(struct file_name_list));
  261. +     gnulib_dir->fname = xmalloc(strlen(gnulib) + 1);
  262. +     strcpy(gnulib_dir->fname, gnulib);
  263. + /* cons it onto the front of the defaults. */
  264. +     gnulib_dir->next = include_defaults;
  265. +     include_defaults = gnulib_dir;
  266. +     }
  267. +   }
  268. + #endif
  269.     /* Process switches and find input file name.  */
  270.   
  271.     for (i = 1; i < argc; i++) {
  272. ***************
  273. *** 968,974 ****
  274. --- 1118,1128 ----
  275.       fp->buf = (U_CHAR *) xmalloc (bsize + 2);
  276.       bufp = fp->buf;
  277.       for (;;) {
  278. + #ifdef atarist
  279. +       cnt = eunuchs_read (f, bufp, bsize - size);
  280. + #else
  281.         cnt = read (f, bufp, bsize - size);
  282. + #endif
  283.         if (cnt < 0) goto perror;    /* error! */
  284.         if (cnt == 0) break;    /* End of file */
  285.         size += cnt;
  286. ***************
  287. *** 988,994 ****
  288. --- 1142,1152 ----
  289.       fp->buf = (U_CHAR *) xmalloc (st_size + 2);
  290.   
  291.       while (st_size > 0) {
  292. + #ifdef atarist
  293. +       i = eunuchs_read (f, fp->buf + fp->length, st_size);
  294. + #else
  295.         i = read (f, fp->buf + fp->length, st_size);
  296. + #endif
  297.         if (i <= 0) {
  298.           if (i == 0) break;
  299.       goto perror;
  300. ***************
  301. *** 1048,1053 ****
  302. --- 1206,1214 ----
  303.     if (ferror (stdout))
  304.       fatal ("I/O error on output");
  305.   
  306. + #ifdef atarist
  307. +   close(fileno(stdout));        /* this shouldn't be necessary */
  308. + #endif
  309.     if (errors)
  310.       exit (FATAL_EXIT_CODE);
  311.     exit (SUCCESS_EXIT_CODE);
  312. ***************
  313. *** 2333,2340 ****
  314. --- 2494,2510 ----
  315.   
  316.         if (string)
  317.       {
  318. + #ifndef atarist
  319.         buf = (char *) alloca (3 + strlen (string));
  320.         sprintf (buf, "\"%s\"", string);
  321. + #else
  322. +           buf = (char *) alloca (16 + strlen (string));
  323. +           {
  324. +           char *tbuf = (char *) alloca (16 + strlen (string));
  325. +           (void) slashifying_bcopy(string, tbuf, strlen(string)+1);
  326. +           sprintf (buf, "\"%s\"", tbuf);
  327. +           }
  328. + #endif /* atarist */
  329.       }
  330.         else
  331.       buf = "\"\"";
  332. ***************
  333. *** 2485,2490 ****
  334. --- 2655,2664 ----
  335.              and put it in front of the search list.  */
  336.           dsp[0].next = stackp;
  337.           stackp = dsp;
  338. + #ifdef atarist
  339. +           if((ep = rindex (nam, '\\')) == NULL)
  340. +           ep = rindex(nam, '/');    /* allow both */
  341. + #else
  342.   #ifndef VMS
  343.           ep = rindex (nam, '/');
  344.   #else                /* VMS */
  345. ***************
  346. *** 2493,2498 ****
  347. --- 2667,2673 ----
  348.           if (ep == NULL) ep = rindex (nam, ':');
  349.           if (ep != NULL) ep++;
  350.   #endif                /* VMS */
  351. + #endif /* atarist */
  352.           if (ep != NULL) {
  353.             n = ep - nam;
  354.             dsp[0].fname = (char *) alloca (n + 1);
  355. ***************
  356. *** 2543,2549 ****
  357. --- 2718,2728 ----
  358.   
  359.     /* If specified file name is absolute, just open it.  */
  360.   
  361. + #ifdef atarist
  362. +   if ((*fbeg == '\\') || (*fbeg == '/')) {
  363. + #else
  364.     if (*fbeg == '/') {
  365. + #endif
  366.       strncpy (fname, fbeg, flen);
  367.       fname[flen] = 0;
  368.       f = open (fname, O_RDONLY, 0666);
  369. ***************
  370. *** 2554,2560 ****
  371. --- 2733,2743 ----
  372.       for (; stackp; stackp = stackp->next) {
  373.         if (stackp->fname) {
  374.       strcpy (fname, stackp->fname);
  375. + #ifdef atarist
  376. +     strcat (fname, "\\");
  377. + #else
  378.       strcat (fname, "/");
  379. + #endif
  380.       fname[strlen (fname) + flen] = 0;
  381.         } else {
  382.       fname[0] = 0;
  383. ***************
  384. *** 2674,2680 ****
  385.       /* Read the file contents, knowing that st_size is an upper bound
  386.          on the number of bytes we can read.  */
  387.       while (st_size > 0) {
  388. !       i = read (f, fp->buf + fp->length, st_size);
  389.         if (i <= 0) {
  390.       if (i == 0) break;
  391.       goto nope;
  392. --- 2857,2867 ----
  393.       /* Read the file contents, knowing that st_size is an upper bound
  394.          on the number of bytes we can read.  */
  395.       while (st_size > 0) {
  396. ! #ifdef atarist
  397. !     i = eunuchs_read (f, fp->buf + fp->length, st_size);
  398. ! #else
  399. !     i = read (f, fp->buf + fp->length, st_size);
  400. ! #endif
  401.         if (i <= 0) {
  402.       if (i == 0) break;
  403.       goto nope;
  404. ***************
  405. *** 2697,2703 ****
  406. --- 2884,2894 ----
  407.       bufp = basep;
  408.   
  409.       for (;;) {
  410. + #ifdef atarist
  411. +     i = eunuchs_read (f, bufp, bsize - st_size);
  412. + #else
  413.         i = read (f, bufp, bsize - st_size);
  414. + #endif
  415.         if (i < 0)
  416.       goto nope;      /* error! */
  417.         if (i == 0)
  418. ***************
  419. *** 4067,4074 ****
  420. --- 4258,4269 ----
  421.     check_expand (op, len + 1);
  422.     if (op->bufp > op->buf && op->bufp[-1] != '\n')
  423.       *op->bufp++ = '\n';
  424. + #ifdef atarist
  425. +   op->bufp = slashifying_bcopy (line_cmd_buf, op->bufp, len);
  426. + #else
  427.     bcopy (line_cmd_buf, op->bufp, len);
  428.     op->bufp += len;
  429. + #endif
  430.     op->lineno = ip->lineno;
  431.   }
  432.   
  433. ***************
  434. *** 4725,4731 ****
  435. --- 4920,4930 ----
  436.     if (ip != NULL)
  437.       fprintf (stderr, "%s:%d: ", ip->fname, ip->lineno);
  438.   
  439. + #ifdef atarist
  440. +   if ((errno > sys_nerr) && (errno < 0))
  441. + #else
  442.     if (errno < sys_nerr)
  443. + #endif
  444.       fprintf (stderr, "%s: %s\n", name, sys_errlist[errno]);
  445.     else
  446.       fprintf (stderr, "%s: undocumented I/O error\n", name);
  447. ***************
  448. *** 5251,5256 ****
  449. --- 5450,5456 ----
  450.     deps_buffer[deps_size] = 0;
  451.   }
  452.   
  453. + #if (!(defined(atarist) || defined(atariminix) || defined(CROSSATARI)))
  454.   #ifndef BSD
  455.   #ifndef BSTRING
  456.   
  457. ***************
  458. *** 5318,5324 ****
  459.   }
  460.   #endif /* not BSTRING */
  461.   #endif /* not BSD */
  462.   
  463.   void
  464.   fatal (str, arg)
  465. --- 5518,5524 ----
  466.   }
  467.   #endif /* not BSTRING */
  468.   #endif /* not BSD */
  469. ! #endif /* not ATARI */
  470.   
  471.   void
  472.   fatal (str, arg)
  473. ***************
  474. *** 5347,5353 ****
  475. --- 5547,5557 ----
  476.     extern char *sys_errlist[];
  477.   
  478.     fprintf (stderr, "%s: ", progname);
  479. + #ifdef atarist
  480. +   if ((errno > sys_nerr) && (errno < 0))
  481. + #else
  482.     if (errno < sys_nerr)
  483. + #endif
  484.       fprintf (stderr, "%s: %s\n", name, sys_errlist[errno]);
  485.     else
  486.       fprintf (stderr, "%s: undocumented I/O error\n", name);
  487. *** ../../../Gnu/gcc-1.36/combine.c    Fri Sep 15 00:40:17 1989
  488. --- combine.c    Wed Sep 27 12:28:46 1989
  489. ***************
  490. *** 814,820 ****
  491. --- 814,824 ----
  492.     register char *fmt;
  493.     register int len, i;
  494.     register enum rtx_code code;
  495. + #if (defined(atarist) || defined(atariminix))
  496. +   short was_replaced[2];    /* 'char' confuses GAS 1.14... */
  497. + #else
  498.     char was_replaced[2];
  499. + #endif
  500.   
  501.   #define SUBST(INTO, NEWVAL)  \
  502.    do { if (undobuf.num_undo < MAX_UNDO)                    \
  503. *** ../../../Gnu/gcc-1.36/gcc.c    Sun Sep 17 16:51:58 1989
  504. --- gcc.c    Sat Sep 30 20:51:53 1989
  505. ***************
  506. *** 117,122 ****
  507. --- 117,131 ----
  508.   
  509.   */
  510.   
  511. + #ifdef CROSSATARI
  512. + #ifdef atarist
  513. + #undef atarist
  514. + #endif
  515. + #ifdef atariminix
  516. + #undef atariminix
  517. + #endif
  518. + #endif
  519. +   
  520.   #include <stdio.h>
  521.   #include <sys/types.h>
  522.   #include <signal.h>
  523. ***************
  524. *** 126,138 ****
  525.   #include "obstack.h"
  526.   #include "gvarargs.h"
  527.   
  528. ! #ifdef USG
  529.   #define R_OK 4
  530.   #define W_OK 2
  531.   #define X_OK 1
  532.   #define vfork fork
  533.   #endif /* USG */
  534.   
  535.   #define obstack_chunk_alloc xmalloc
  536.   #define obstack_chunk_free free
  537.   extern int xmalloc ();
  538. --- 135,154 ----
  539.   #include "obstack.h"
  540.   #include "gvarargs.h"
  541.   
  542. ! #if (defined(USG) || defined(atariminix))
  543.   #define R_OK 4
  544.   #define W_OK 2
  545.   #define X_OK 1
  546.   #define vfork fork
  547.   #endif /* USG */
  548.   
  549. + #ifdef atarist
  550. + #include <osbind.h>
  551. + #include <ctype.h>
  552. + long _stksize = 8192;
  553. + extern char *getenv();
  554. + #endif
  555.   #define obstack_chunk_alloc xmalloc
  556.   #define obstack_chunk_free free
  557.   extern int xmalloc ();
  558. ***************
  559. *** 232,239 ****
  560.   {
  561.     {".c",
  562.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} %{trigraphs} -undef \
  563. !         -D__GNUC__ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!ansi:%p} %P\
  564. !         %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\
  565.       %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  566.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  567.       %{!M*:%{!E:cc1 %{!pipe:%g.cpp} %1 \
  568. --- 248,256 ----
  569.   {
  570.     {".c",
  571.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} %{trigraphs} -undef \
  572. !         -D__GNUC__ %{ansi:-trigraphs -$ -D__STRICT_ANSI__} %{!ansi:%p}\
  573. !         %c %{O:-D__OPTIMIZE__} %{mshort:-D__MSHORT__} %{traditional}\
  574. !         %{pedantic}\
  575.       %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  576.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  577.       %{!M*:%{!E:cc1 %{!pipe:%g.cpp} %1 \
  578. ***************
  579. *** 247,254 ****
  580.                         %{!pipe:%g.s}\n }}}"},
  581.     {".cc",
  582.      "cpp -+ %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} \
  583. !         -undef -D__GNUC__ %p %P\
  584. !         %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\
  585.       %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  586.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  587.       %{!M*:%{!E:cc1plus %{!pipe:%g.cpp} %1\
  588. --- 264,272 ----
  589.                         %{!pipe:%g.s}\n }}}"},
  590.     {".cc",
  591.      "cpp -+ %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{i*} \
  592. !         -undef -D__GNUC__ %p\
  593. !         %c %{O:-D__OPTIMIZE__} %{mshort:-D__MSHORT__} %{traditional}\
  594. !         %{pedantic}\
  595.       %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  596.           %i %{!M*:%{!E:%{!pipe:%g.cpp}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  597.       %{!M*:%{!E:cc1plus %{!pipe:%g.cpp} %1\
  598. ***************
  599. *** 272,279 ****
  600.               %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  601.     {".S",
  602.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{trigraphs} \
  603. !         -undef -D__GNUC__ -$ %p %P\
  604. !         %c %{O:-D__OPTIMIZE__} %{traditional} %{pedantic}\
  605.       %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  606.           %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  607.       %{!M*:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a \
  608. --- 290,298 ----
  609.               %{c:%{o*}%{!o*:-o %w%b.o}}%{!c:-o %d%w%b.o} %i\n }"},
  610.     {".S",
  611.      "cpp %{nostdinc} %{C} %{v} %{D*} %{U*} %{I*} %{M*} %{trigraphs} \
  612. !         -undef -D__GNUC__ -$ %p\
  613. !         %c %{O:-D__OPTIMIZE__} %{mshort:-D__MSHORT__} %{traditional}\
  614. !         %{pedantic}\
  615.       %{Wcomment*} %{Wtrigraphs} %{Wall} %C\
  616.           %i %{!M*:%{!E:%{!pipe:%g.s}}}%{E:%{o*}}%{M*:%{o*}} |\n\
  617.       %{!M*:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a \
  618. ***************
  619. *** 284,293 ****
  620. --- 303,324 ----
  621.   };
  622.   
  623.   /* Here is the spec for running the linker, after compiling all files.  */
  624. + #if (defined(CROSSATARI) || defined(atarist) || defined(atariminix))
  625. +  
  626. +  char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
  627. +  %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
  628. +  %{y*} %{!nostdlib:%S} \
  629. +  %{L*} %o %{!nostdlib:%s %L}\n }}}}";
  630. + #else
  631.   char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
  632.    %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
  633.    %{y*} %{!A:%{!nostdlib:%S}} \
  634.    %{L*} %o %{!nostdlib:gnulib%s %{g:-lg} %L}\n }}}}";
  635. + #endif /* not atari */
  636.   
  637.   /* Accumulate a command (program name and args), and run it.  */
  638.   
  639. ***************
  640. *** 327,348 ****
  641.   
  642.   /* Suffix to attach to directories searched for commands.  */
  643.   
  644. ! char *machine_suffix = 0;
  645.   
  646.   /* Default prefixes to attach to command names.  */
  647.   
  648.   #ifndef STANDARD_EXEC_PREFIX
  649. ! #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-"
  650.   #endif /* !defined STANDARD_EXEC_PREFIX */
  651.   
  652.   char *standard_exec_prefix = STANDARD_EXEC_PREFIX;
  653.   char *standard_exec_prefix_1 = "/usr/lib/gcc-";
  654.   
  655. ! #ifndef STANDARD_STARTFILE_PREFIX
  656. ! #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
  657. ! #endif /* !defined STANDARD_STARTFILE_PREFIX */
  658.   
  659. - char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
  660.   char *standard_startfile_prefix_1 = "/lib/";
  661.   char *standard_startfile_prefix_2 = "/usr/lib/";
  662.   
  663. --- 358,403 ----
  664.   
  665.   /* Suffix to attach to directories searched for commands.  */
  666.   
  667. ! #ifndef atarist
  668. !   char *machine_suffix = 0;
  669. ! #else
  670. !   char *machine_suffix = ".ttp";
  671. ! #endif
  672.   
  673.   /* Default prefixes to attach to command names.  */
  674.   
  675.   #ifndef STANDARD_EXEC_PREFIX
  676. ! #  ifdef CROSSATARI
  677. ! #    ifdef MINIX
  678. ! #      define STANDARD_EXEC_PREFIX "/dsrg/bammi/cross-minix/lib/gcc-"
  679. ! #    else
  680. ! #      define STANDARD_EXEC_PREFIX "/dsrg/bammi/cross-gcc/lib/gcc-"
  681. ! #    endif /* MINIX */
  682. ! #  else /* not cross compiler */
  683. ! #    define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-"
  684. ! #  endif /* CROSSATARI */
  685.   #endif /* !defined STANDARD_EXEC_PREFIX */
  686.   
  687.   char *standard_exec_prefix = STANDARD_EXEC_PREFIX;
  688.   char *standard_exec_prefix_1 = "/usr/lib/gcc-";
  689.   
  690. ! #ifdef CROSSATARI
  691. ! #  ifdef MINIX
  692. !     char *standard_startfile_prefix = "/dsrg/bammi/cross-minix/lib/";
  693. ! #  else
  694. !     char *standard_startfile_prefix = "/dsrg/bammi/cross-gcc/lib/";
  695. ! #  endif
  696. ! #else
  697. ! #  ifdef atariminix
  698. !     char *standard_startfile_prefix = "/usr/local/lib/";
  699. ! #  else
  700. ! #    ifndef STANDARD_STARTFILE_PREFIX
  701. ! #      define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
  702. ! #    endif /* !defined STANDARD_STARTFILE_PREFIX */
  703. !      char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
  704. ! #  endif
  705. ! #endif
  706.   
  707.   char *standard_startfile_prefix_1 = "/lib/";
  708.   char *standard_startfile_prefix_2 = "/usr/lib/";
  709.   
  710. ***************
  711. *** 520,527 ****
  712.   choose_temp_base ()
  713.   {
  714.     extern char *getenv ();
  715. -   char *base = getenv ("TMPDIR");
  716.     int len;
  717.   
  718.     if (base == (char *)0)
  719.       {
  720. --- 575,588 ----
  721.   choose_temp_base ()
  722.   {
  723.     extern char *getenv ();
  724.     int len;
  725. + #if (!(defined(atarist) || defined(atariminix)))
  726. +   char *base = getenv ("TMPDIR");
  727. + #else
  728. +   char *base = getenv ("TEMP");
  729. +   if(base == (char *)0)
  730. +       base = getenv("TMPDIR");
  731. + #endif
  732.   
  733.     if (base == (char *)0)
  734.       {
  735. ***************
  736. *** 579,586 ****
  737.         if (machine_suffix)
  738.       {
  739.         strcpy (temp, user_exec_prefix);
  740. -       strcat (temp, machine_suffix);
  741.         strcat (temp, prog);
  742.         win = (access (temp, X_OK) == 0);
  743.       }
  744.         if (!win)
  745. --- 640,647 ----
  746.         if (machine_suffix)
  747.       {
  748.         strcpy (temp, user_exec_prefix);
  749.         strcat (temp, prog);
  750. +       strcat (temp, machine_suffix);
  751.         win = (access (temp, X_OK) == 0);
  752.       }
  753.         if (!win)
  754. ***************
  755. *** 596,603 ****
  756.         if (machine_suffix)
  757.       {
  758.         strcpy (temp, env_exec_prefix);
  759. -       strcat (temp, machine_suffix);
  760.         strcat (temp, prog);
  761.         win = (access (temp, X_OK) == 0);
  762.       }
  763.         if (!win)
  764. --- 657,664 ----
  765.         if (machine_suffix)
  766.       {
  767.         strcpy (temp, env_exec_prefix);
  768.         strcat (temp, prog);
  769. +       strcat (temp, machine_suffix);
  770.         win = (access (temp, X_OK) == 0);
  771.       }
  772.         if (!win)
  773. ***************
  774. *** 613,620 ****
  775.         if (machine_suffix)
  776.       {
  777.         strcpy (temp, standard_exec_prefix);
  778. -       strcat (temp, machine_suffix);
  779.         strcat (temp, prog);
  780.         win = (access (temp, X_OK) == 0);
  781.       }
  782.         if (!win)
  783. --- 674,681 ----
  784.         if (machine_suffix)
  785.       {
  786.         strcpy (temp, standard_exec_prefix);
  787.         strcat (temp, prog);
  788. +       strcat (temp, machine_suffix);
  789.         win = (access (temp, X_OK) == 0);
  790.       }
  791.         if (!win)
  792. ***************
  793. *** 630,637 ****
  794.         if (machine_suffix)
  795.       {
  796.         strcpy (temp, standard_exec_prefix_1);
  797. -       strcat (temp, machine_suffix);
  798.         strcat (temp, prog);
  799.         win = (access (temp, X_OK) == 0);
  800.       }
  801.         if (!win)
  802. --- 691,698 ----
  803.         if (machine_suffix)
  804.       {
  805.         strcpy (temp, standard_exec_prefix_1);
  806.         strcat (temp, prog);
  807. +       strcat (temp, machine_suffix);
  808.         win = (access (temp, X_OK) == 0);
  809.       }
  810.         if (!win)
  811. ***************
  812. *** 671,676 ****
  813. --- 732,738 ----
  814.      NOT_LAST is nonzero if this is not the last subcommand
  815.      (i.e. its output should be piped to the next one.)  */
  816.   
  817. + #ifndef atarist
  818.   static int
  819.   pexecute (func, program, argv, not_last)
  820.        char *program;
  821. ***************
  822. *** 741,746 ****
  823. --- 803,809 ----
  824.         return pid;
  825.       }
  826.   }
  827. + #endif /* atarist */
  828.   
  829.   /* Execute the command specified by the arguments on the current line of spec.
  830.      When using pipes, this includes several piped-together commands
  831. ***************
  832. *** 758,773 ****
  833.       {
  834.         char *prog;        /* program name.  */
  835.         char **argv;        /* vector of args.  */
  836.         int pid;            /* pid of process for this command.  */
  837.       };
  838.   
  839.     struct command *commands;    /* each command buffer with above info.  */
  840.   
  841.     /* Count # of piped commands.  */
  842.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  843.       if (strcmp (argbuf[i], "|") == 0)
  844. !       n_commands++;
  845.     /* Get storage for each command.  */
  846.     commands
  847.       = (struct command *) alloca (n_commands * sizeof (struct command));
  848. --- 821,842 ----
  849.       {
  850.         char *prog;        /* program name.  */
  851.         char **argv;        /* vector of args.  */
  852. + #ifndef atarist
  853.         int pid;            /* pid of process for this command.  */
  854. + #endif
  855.       };
  856.   
  857.     struct command *commands;    /* each command buffer with above info.  */
  858.   
  859. + #ifndef atarist
  860.     /* Count # of piped commands.  */
  861.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  862.       if (strcmp (argbuf[i], "|") == 0)
  863. !      n_commands++;
  864. ! #else
  865. !   n_commands = 1;
  866. ! #endif
  867. !   
  868.     /* Get storage for each command.  */
  869.     commands
  870.       = (struct command *) alloca (n_commands * sizeof (struct command));
  871. ***************
  872. *** 782,787 ****
  873. --- 851,857 ----
  874.     if (string)
  875.       commands[0].argv[0] = string;
  876.   
  877. + #ifndef atarist
  878.     for (n_commands = 1, i = 0; i < argbuf_index; i++)
  879.       if (strcmp (argbuf[i], "|") == 0)
  880.         {                /* each command.  */
  881. ***************
  882. *** 793,799 ****
  883.         commands[n_commands].argv[0] = string;
  884.       n_commands++;
  885.         }
  886.     argbuf[argbuf_index] = 0;
  887.   
  888.     /* If -v, print what we are about to do, and maybe query.  */
  889. --- 863,872 ----
  890.         commands[n_commands].argv[0] = string;
  891.       n_commands++;
  892.         }
  893. ! #else
  894. !   n_commands = 1;
  895. ! #endif
  896. !   
  897.     argbuf[argbuf_index] = 0;
  898.   
  899.     /* If -v, print what we are about to do, and maybe query.  */
  900. ***************
  901. *** 808,818 ****
  902.         for (j = commands[i].argv; *j; j++)
  903.           fprintf (stderr, " %s", *j);
  904.   
  905.         /* Print a pipe symbol after all but the last command.  */
  906.         if (i + 1 != n_commands)
  907.           fprintf (stderr, " |");
  908.         fprintf (stderr, "\n");
  909. !     }
  910.         fflush (stderr);
  911.   #ifdef DEBUG
  912.         fprintf (stderr, "\nGo ahead? (y or n) ");
  913. --- 881,893 ----
  914.         for (j = commands[i].argv; *j; j++)
  915.           fprintf (stderr, " %s", *j);
  916.   
  917. + #ifndef atarist
  918.         /* Print a pipe symbol after all but the last command.  */
  919.         if (i + 1 != n_commands)
  920.           fprintf (stderr, " |");
  921. + #endif
  922.         fprintf (stderr, "\n");
  923. !       }
  924.         fflush (stderr);
  925.   #ifdef DEBUG
  926.         fprintf (stderr, "\nGo ahead? (y or n) ");
  927. ***************
  928. *** 825,842 ****
  929. --- 900,926 ----
  930.   #endif /* DEBUG */
  931.       }
  932.   
  933. + #ifndef atarist
  934.     /* Run each piped subprocess.  */
  935.   
  936.     last_pipe_input = STDIN_FILE_NO;
  937.     for (i = 0; i < n_commands; i++)
  938.       {
  939. + #ifndef atariminix
  940.         extern int execv(), execvp();
  941.         char *string = commands[i].argv[0];
  942.   
  943.         commands[i].pid = pexecute ((string != commands[i].prog ? execv : execvp),
  944.                     string, commands[i].argv,
  945.                     i + 1 < n_commands);
  946. + #else
  947. +       extern int execv();
  948. +       char *string = commands[i].argv[0];
  949.   
  950. +       commands[i].pid = pexecute (execv,
  951. +                   string, commands[i].argv,
  952. +                   i + 1 < n_commands);
  953. + #endif
  954.         if (string != commands[i].prog)
  955.       free (string);
  956.       }
  957. ***************
  958. *** 875,881 ****
  959. --- 959,982 ----
  960.         }
  961.       return ret_code;
  962.     }
  963. + #else  /* atarist */
  964. +  {
  965. +      register int iii;
  966. +      char **j;
  967. +      execution_count++;
  968. +      for (i = 0; i < n_commands ; i++)
  969. +      {
  970. +      j = commands[i].argv;
  971. +          iii = spawnve(0, j[0], j, NULL);
  972. +      if(iii != 0)
  973. +          return -1;
  974. +      }
  975. +      return 0;
  976. +  }
  977. + #endif /* atarist */  
  978.   }
  979.   
  980.   /* Find all the switches given to us
  981.      and make a vector describing them.
  982. ***************
  983. *** 1032,1037 ****
  984. --- 1133,1148 ----
  985.      search dirs for it.  */
  986.   int this_is_library_file;
  987.   
  988. + #ifdef atarist
  989. + /* I don't know why this is necessary.  Recursive calls to do_spec_1
  990. +    end up ignoring the error code from calls to execute().  That causes
  991. +    do_spec to get a 0 return value, and do_spec_1("\n"), which causes the
  992. +    command to get executed again.
  993. + */
  994. + int execute_return_error = 0;
  995. + #endif
  996.   /* Process the spec SPEC and run the commands specified therein.
  997.      Returns 0 if the spec is successfully processed; -1 if failed.  */
  998.   
  999. ***************
  1000. *** 1051,1060 ****
  1001. --- 1162,1180 ----
  1002.   
  1003.     /* Force out any unfinished command.
  1004.        If -pipe, this forces out the last command if it ended in `|'.  */
  1005. + #ifdef atarist
  1006. +   if (!value && execute_return_error)
  1007. +     {
  1008. +     value = execute_return_error;
  1009. +     execute_return_error = 0;
  1010. +     }
  1011. + #endif
  1012.     if (value == 0)
  1013.       {
  1014. + #ifndef atarist
  1015.         if (argbuf_index > 0 && !strcmp (argbuf[argbuf_index - 1], "|"))
  1016.       argbuf_index--;
  1017. + #endif
  1018.   
  1019.         if (argbuf_index > 0)
  1020.       value = execute ();
  1021. ***************
  1022. *** 1083,1094 ****
  1023. --- 1203,1248 ----
  1024.     register char *p = spec;
  1025.     register int c;
  1026.     char *string;
  1027. +   extern char *find_file();    /* ++jrb */
  1028.   
  1029.     while (c = *p++)
  1030.       /* If substituting a switch, treat all chars like letters.
  1031.          Otherwise, NL, SPC, TAB and % are special.  */
  1032.       switch (inswitch ? 'a' : c)
  1033.         {
  1034. + #ifdef atarist
  1035. + /* this stuff added by jrd.  if see '$', expect name of env var, delimited
  1036. +    by '$'.  Find it's value, and subst it in.
  1037. +    modified by ERS to only collect things that look like names; this
  1038. +    saves e.g. the -$ arg. to cpp from getting munged */
  1039. +       case '$':
  1040. +       {
  1041. +     char varname[32];        /* should be enough */
  1042. +     char * value;            /* deciphered value string */
  1043. +     int i;
  1044. +     for (i = 0 ; ((c = *p) != '$') && isalnum(c) && i < 31 ; i++, p++)
  1045. +         varname[i] = c;
  1046. +     varname[i] = '\0';
  1047. +     if (strlen(varname) > 0) /* ++jrb fix */
  1048. +     {
  1049. +                  ++p;    /* skip trailing '$' */
  1050. +         value = (char * )getenv(varname); /* ++jrb fix */
  1051. +         if (value)
  1052. +             do_spec_1(value, 0);
  1053. +             else
  1054. +             do_spec_1(".", 0);    /* a compleat kludge... */
  1055. +     }
  1056. +         else
  1057. +         {
  1058. +              obstack_1grow(&obstack, '$');
  1059. +              arg_going = 1;
  1060. +         }
  1061. +       }
  1062. +      break;
  1063. + #endif /* atarist */
  1064.         case '\n':
  1065.       /* End of line: finish any pending argument,
  1066.          then run the pending command if one has been started.  */
  1067. ***************
  1068. *** 1126,1131 ****
  1069. --- 1280,1289 ----
  1070.       if (argbuf_index > 0)
  1071.         {
  1072.           int value = execute ();
  1073. + #ifdef atarist
  1074. +         if (!execute_return_error)
  1075. +             execute_return_error = value;
  1076. + #endif
  1077.           if (value)
  1078.             return value;
  1079.         }
  1080. ***************
  1081. *** 1312,1317 ****
  1082. --- 1470,1479 ----
  1083.           break;
  1084.   
  1085.         default:
  1086. + #ifdef atarist
  1087. +         fprintf(stderr, "Bogus char '%c' found at pos %d of spec '%s'\n",
  1088. +         c, (p - spec - 1), spec);
  1089. + #endif
  1090.           abort ();
  1091.         }
  1092.       break;
  1093. ***************
  1094. *** 1342,1355 ****
  1095.          This is used in %{|!pipe:...}.  */
  1096.       pipe = 1, ++p;
  1097.   
  1098. !   if (*p == '!')
  1099.       /* A `!' after the open-brace negates the condition:
  1100.          succeed if the specified switch is not present.  */
  1101.       negate = 1, ++p;
  1102.   
  1103. !   filter = p;
  1104. !   while (*p != ':' && *p != '}') p++;
  1105. !   if (*p != '}')
  1106.       {
  1107.         register int count = 1;
  1108.         q = p + 1;
  1109. --- 1504,1517 ----
  1110.          This is used in %{|!pipe:...}.  */
  1111.       pipe = 1, ++p;
  1112.   
  1113. !    if (*p == '!')
  1114.       /* A `!' after the open-brace negates the condition:
  1115.          succeed if the specified switch is not present.  */
  1116.       negate = 1, ++p;
  1117.   
  1118. !     filter = p;
  1119. !     while (*p != ':' && *p != '}') p++;
  1120. !     if (*p != '}')
  1121.       {
  1122.         register int count = 1;
  1123.         q = p + 1;
  1124. ***************
  1125. *** 1425,1431 ****
  1126.           return 0;
  1127.           }
  1128.       }
  1129. !       else if (pipe)
  1130.       {
  1131.         /* Here if a %{|...} conditional fails: output a minus sign,
  1132.            which means "standard output" or "standard input".  */
  1133. --- 1587,1593 ----
  1134.           return 0;
  1135.           }
  1136.       }
  1137. !         else if (pipe)
  1138.       {
  1139.         /* Here if a %{|...} conditional fails: output a minus sign,
  1140.            which means "standard output" or "standard input".  */
  1141. ***************
  1142. *** 1496,1503 ****
  1143.         if (machine_suffix)
  1144.       {
  1145.         strcpy (temp, user_exec_prefix);
  1146. -       strcat (temp, machine_suffix);
  1147.         strcat (temp, name);
  1148.         win = (access (temp, R_OK) == 0);
  1149.       }
  1150.         if (!win)
  1151. --- 1658,1665 ----
  1152.         if (machine_suffix)
  1153.       {
  1154.         strcpy (temp, user_exec_prefix);
  1155.         strcat (temp, name);
  1156. +       strcat (temp, machine_suffix);
  1157.         win = (access (temp, R_OK) == 0);
  1158.       }
  1159.         if (!win)
  1160. ***************
  1161. *** 1513,1520 ****
  1162.         if (machine_suffix)
  1163.       {
  1164.         strcpy (temp, env_exec_prefix);
  1165. -       strcat (temp, machine_suffix);
  1166.         strcat (temp, name);
  1167.         win = (access (temp, R_OK) == 0);
  1168.       }
  1169.         if (!win)
  1170. --- 1675,1682 ----
  1171.         if (machine_suffix)
  1172.       {
  1173.         strcpy (temp, env_exec_prefix);
  1174.         strcat (temp, name);
  1175. +       strcat (temp, machine_suffix);
  1176.         win = (access (temp, R_OK) == 0);
  1177.       }
  1178.         if (!win)
  1179. ***************
  1180. *** 1530,1537 ****
  1181.         if (machine_suffix)
  1182.       {
  1183.         strcpy (temp, standard_exec_prefix);
  1184. -       strcat (temp, machine_suffix);
  1185.         strcat (temp, name);
  1186.         win = (access (temp, R_OK) == 0);
  1187.       }
  1188.         if (!win)
  1189. --- 1692,1699 ----
  1190.         if (machine_suffix)
  1191.       {
  1192.         strcpy (temp, standard_exec_prefix);
  1193.         strcat (temp, name);
  1194. +       strcat (temp, machine_suffix);
  1195.         win = (access (temp, R_OK) == 0);
  1196.       }
  1197.         if (!win)
  1198. ***************
  1199. *** 1547,1554 ****
  1200.         if (machine_suffix)
  1201.       {
  1202.         strcpy (temp, standard_exec_prefix_1);
  1203. -       strcat (temp, machine_suffix);
  1204.         strcat (temp, name);
  1205.         win = (access (temp, R_OK) == 0);
  1206.       }
  1207.         if (!win)
  1208. --- 1709,1716 ----
  1209.         if (machine_suffix)
  1210.       {
  1211.         strcpy (temp, standard_exec_prefix_1);
  1212.         strcat (temp, name);
  1213. +       strcat (temp, machine_suffix);
  1214.         win = (access (temp, R_OK) == 0);
  1215.       }
  1216.         if (!win)
  1217. ***************
  1218. *** 1564,1571 ****
  1219.         if (machine_suffix)
  1220.       {
  1221.         strcpy (temp, standard_startfile_prefix);
  1222. -       strcat (temp, machine_suffix);
  1223.         strcat (temp, name);
  1224.         win = (access (temp, R_OK) == 0);
  1225.       }
  1226.         if (!win)
  1227. --- 1726,1733 ----
  1228.         if (machine_suffix)
  1229.       {
  1230.         strcpy (temp, standard_startfile_prefix);
  1231.         strcat (temp, name);
  1232. +       strcat (temp, machine_suffix);
  1233.         win = (access (temp, R_OK) == 0);
  1234.       }
  1235.         if (!win)
  1236. ***************
  1237. *** 1581,1588 ****
  1238.         if (machine_suffix)
  1239.       {
  1240.         strcpy (temp, standard_startfile_prefix_1);
  1241. -       strcat (temp, machine_suffix);
  1242.         strcat (temp, name);
  1243.         win = (access (temp, R_OK) == 0);
  1244.       }
  1245.         if (!win)
  1246. --- 1743,1750 ----
  1247.         if (machine_suffix)
  1248.       {
  1249.         strcpy (temp, standard_startfile_prefix_1);
  1250.         strcat (temp, name);
  1251. +       strcat (temp, machine_suffix);
  1252.         win = (access (temp, R_OK) == 0);
  1253.       }
  1254.         if (!win)
  1255. ***************
  1256. *** 1598,1605 ****
  1257.         if (machine_suffix)
  1258.       {
  1259.         strcpy (temp, standard_startfile_prefix_2);
  1260. -       strcat (temp, machine_suffix);
  1261.         strcat (temp, name);
  1262.         win = (access (temp, R_OK) == 0);
  1263.       }
  1264.         if (!win)
  1265. --- 1760,1767 ----
  1266.         if (machine_suffix)
  1267.       {
  1268.         strcpy (temp, standard_startfile_prefix_2);
  1269.         strcat (temp, name);
  1270. +       strcat (temp, machine_suffix);
  1271.         win = (access (temp, R_OK) == 0);
  1272.       }
  1273.         if (!win)
  1274. ***************
  1275. *** 1615,1622 ****
  1276.         if (machine_suffix)
  1277.       {
  1278.         strcpy (temp, "./");
  1279. -       strcat (temp, machine_suffix);
  1280.         strcat (temp, name);
  1281.         win = (access (temp, R_OK) == 0);
  1282.       }
  1283.         if (!win)
  1284. --- 1777,1784 ----
  1285.         if (machine_suffix)
  1286.       {
  1287.         strcpy (temp, "./");
  1288.         strcat (temp, name);
  1289. +       strcat (temp, machine_suffix);
  1290.         win = (access (temp, R_OK) == 0);
  1291.       }
  1292.         if (!win)
  1293. ***************
  1294. *** 1634,1639 ****
  1295. --- 1796,1802 ----
  1296.   
  1297.   /* On fatal signals, delete all the temporary files.  */
  1298.   
  1299. + #ifndef atarist
  1300.   void
  1301.   fatal_error (signum)
  1302.        int signum;
  1303. ***************
  1304. *** 1645,1650 ****
  1305. --- 1808,1814 ----
  1306.        so its normal effect occurs.  */
  1307.     kill (getpid (), signum);
  1308.   }
  1309. + #endif /* atarist */
  1310.   
  1311.   int
  1312.   main (argc, argv)
  1313. ***************
  1314. *** 1657,1670 ****
  1315. --- 1821,1842 ----
  1316.     int linker_was_run = 0;
  1317.     char *explicit_link_files;
  1318.   
  1319. + #ifdef atarist
  1320. + /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  1321. + /*  _malloczero(1); */     /* zero mallocs by default */
  1322. +   programname = "gcc";
  1323. + #else  
  1324.     programname = argv[0];
  1325. + #endif
  1326.   
  1327. + #ifndef atarist
  1328.     if (signal (SIGINT, SIG_IGN) != SIG_IGN)
  1329.       signal (SIGINT, fatal_error);
  1330.     if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
  1331.       signal (SIGHUP, fatal_error);
  1332.     if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
  1333.       signal (SIGTERM, fatal_error);
  1334. + #endif
  1335.   
  1336.     argbuf_length = 10;
  1337.     argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
  1338. ***************
  1339. *** 1678,1683 ****
  1340. --- 1850,1865 ----
  1341.   
  1342.     process_command (argc, argv);
  1343.   
  1344. + #ifdef atarist
  1345. + /* if no default dir specified for executables, look for an env var
  1346. +    called 'GCCEXEC' and use that */
  1347. +   if (!user_exec_prefix)
  1348. +       {
  1349. +     user_exec_prefix = getenv("GCCEXEC");
  1350. +     }
  1351. + #endif /* atarist */
  1352.     if (vflag)
  1353.       {
  1354.         extern char *version_string;
  1355. ***************
  1356. *** 1730,1736 ****
  1357. --- 1912,1923 ----
  1358.   
  1359.             input_basename = input_filename;
  1360.             for (p = input_filename; *p; p++)
  1361. + #ifdef atarist
  1362. +         if (((*p == '/') || (*p == '\\')) && (*(p-1) != ':'))
  1363. +             /* allow both '\' and '/' with  our new lib */
  1364. + #else
  1365.           if (*p == '/')
  1366. + #endif
  1367.             input_basename = p + 1;
  1368.             basename_length = (input_filename_length - strlen (cp->suffix)
  1369.                    - (input_basename - input_filename));
  1370. ***************
  1371. *** 1852,1858 ****
  1372. --- 2039,2049 ----
  1373.     extern char *sys_errlist[];
  1374.     char *s;
  1375.   
  1376. + #ifdef atarist
  1377. +   if ((errno > sys_nerr) && (errno < 0))
  1378. + #else
  1379.     if (errno < sys_nerr)
  1380. + #endif
  1381.       s = concat ("%s: ", sys_errlist[errno], "");
  1382.     else
  1383.       s = "cannot open %s";
  1384. ***************
  1385. *** 1866,1872 ****
  1386. --- 2057,2067 ----
  1387.     extern char *sys_errlist[];
  1388.     char *s;
  1389.   
  1390. + #ifdef atarist
  1391. +   if ((errno > sys_nerr) && (errno < 0))
  1392. + #else
  1393.     if (errno < sys_nerr)
  1394. + #endif
  1395.       s = concat ("%s: ", sys_errlist[errno], "");
  1396.     else
  1397.       s = "cannot open %s";
  1398. ***************
  1399. *** 1880,1886 ****
  1400. --- 2075,2085 ----
  1401.     extern char *sys_errlist[];
  1402.     char *s;
  1403.   
  1404. + #ifdef atarist
  1405. +   if ((errno > sys_nerr) && (errno < 0))
  1406. + #else
  1407.     if (errno < sys_nerr)
  1408. + #endif
  1409.       s = concat ("installation problem, cannot exec %s: ",
  1410.           sys_errlist[errno], "");
  1411.     else
  1412. *** ../../../Gnu/gcc-1.36/toplev.c    Thu Sep  7 23:21:14 1989
  1413. --- toplev.c    Sat Sep 30 20:51:54 1989
  1414. ***************
  1415. *** 40,49 ****
  1416.   #include <time.h>   /* Correct for hpux at least.  Is it good on other USG?  */
  1417.   #else
  1418.   #ifndef VMS
  1419.   #include <sys/time.h>
  1420.   #include <sys/resource.h>
  1421.   #endif
  1422. - #endif
  1423.   
  1424.   #include "input.h"
  1425.   #include "tree.h"
  1426. --- 40,57 ----
  1427.   #include <time.h>   /* Correct for hpux at least.  Is it good on other USG?  */
  1428.   #else
  1429.   #ifndef VMS
  1430. + #if (!(defined(atarist) || defined(atariminix)))
  1431.   #include <sys/time.h>
  1432.   #include <sys/resource.h>
  1433. + #endif /* !(atarist || atariminix) */
  1434. + #endif /* !VMS */
  1435. + #endif /* USG */
  1436. + #ifdef atariminix
  1437. + #include <sys/times.h>
  1438. + /* #include <minix/const.h>, avoid dragging this in */
  1439. + #define HZ 60    /* this is the only thing needed from minix/const.h */
  1440.   #endif
  1441.   
  1442.   #include "input.h"
  1443.   #include "tree.h"
  1444. ***************
  1445. *** 51,56 ****
  1446. --- 59,69 ----
  1447.   #include "rtl.h"
  1448.   #include "flags.h"
  1449.   
  1450. + #ifdef atarist
  1451. +   extern long _stksize = 128L * 1024L;        /* for 1M ST's */
  1452. +   /* extern long _stksize = 500000; */        /* enough to compile -O gas */
  1453. + #endif /* atarist */
  1454.   extern int yydebug;
  1455.   
  1456.   extern FILE *finput;
  1457. ***************
  1458. *** 375,381 ****
  1459.   int
  1460.   gettime ()
  1461.   {
  1462. ! #ifdef USG
  1463.     struct tms tms;
  1464.   #else
  1465.   #ifndef VMS
  1466. --- 388,397 ----
  1467.   int
  1468.   gettime ()
  1469.   {
  1470. ! #ifdef atarist
  1471. !   long now;
  1472. ! #else
  1473. ! #if (defined(USG) || defined(atariminix))
  1474.     struct tms tms;
  1475.   #else
  1476.   #ifndef VMS
  1477. ***************
  1478. *** 390,400 ****
  1479.       } vms_times;
  1480.   #endif
  1481.   #endif
  1482.   
  1483.     if (quiet_flag)
  1484.       return 0;
  1485.   
  1486. ! #ifdef USG
  1487.     times (&tms);
  1488.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  1489.   #else
  1490. --- 406,420 ----
  1491.       } vms_times;
  1492.   #endif
  1493.   #endif
  1494. + #endif
  1495.   
  1496.     if (quiet_flag)
  1497.       return 0;
  1498.   
  1499. ! #ifdef atarist
  1500. !   return(time(NULL) * 1000000);
  1501. ! #else
  1502. ! #if (defined(USG) || defined(atariminix))
  1503.     times (&tms);
  1504.     return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
  1505.   #else
  1506. ***************
  1507. *** 407,412 ****
  1508. --- 427,433 ----
  1509.     return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
  1510.   #endif
  1511.   #endif
  1512. + #endif        /* atarist */
  1513.   }
  1514.   
  1515.   #define TIMEVAR(VAR, BODY)    \
  1516. ***************
  1517. *** 850,855 ****
  1518. --- 871,877 ----
  1519.     longjmp (float_handler, 1);
  1520.   }
  1521.   
  1522. + #ifndef atarist
  1523.   /* Handler for SIGPIPE.  */
  1524.   
  1525.   static void
  1526. ***************
  1527. *** 857,862 ****
  1528. --- 879,885 ----
  1529.   {
  1530.     fatal ("output pipe has been closed");
  1531.   }
  1532. + #endif
  1533.   
  1534.   /* Compile an entire file of output from cpp, named NAME.
  1535.      Write a file of assembly output and various debugging dumps.  */
  1536. ***************
  1537. *** 1735,1747 ****
  1538.     char *filename = 0;
  1539.     int print_mem_flag = 0;
  1540.     char *p;
  1541.     /* save in case md file wants to emit args as a comment.  */
  1542.     save_argc = argc;
  1543.     save_argv = argv;
  1544.   
  1545.     p = argv[0] + strlen (argv[0]);
  1546.     while (p != argv[0] && p[-1] != '/') --p;
  1547.     progname = p;
  1548.   
  1549.   #ifdef RLIMIT_STACK
  1550. --- 1758,1778 ----
  1551.     char *filename = 0;
  1552.     int print_mem_flag = 0;
  1553.     char *p;
  1554. ! #ifdef atarist
  1555. ! /* turn this on if you are going to set the TOS 1.4 dont clear heap flag */
  1556. ! /*  _malloczero(1); */     /* zero mallocs by default */
  1557. ! #endif  
  1558.     /* save in case md file wants to emit args as a comment.  */
  1559.     save_argc = argc;
  1560.     save_argv = argv;
  1561.   
  1562.     p = argv[0] + strlen (argv[0]);
  1563. + #ifndef atarist
  1564.     while (p != argv[0] && p[-1] != '/') --p;
  1565. + #else
  1566. +   while (p != argv[0] && ( ((p[-1] != '/') || (p[-1] != '\\')) &&
  1567. +               (p[-2] != ':') ) ) --p;
  1568. + #endif
  1569.     progname = p;
  1570.   
  1571.   #ifdef RLIMIT_STACK
  1572. ***************
  1573. *** 1758,1764 ****
  1574. --- 1789,1797 ----
  1575.   
  1576.     signal (SIGFPE, float_signal);
  1577.   
  1578. + #ifndef atarist
  1579.     signal (SIGPIPE, pipe_closed);
  1580. + #endif
  1581.   
  1582.     /* Initialize whether `char' is signed.  */
  1583.     flag_signed_char = DEFAULT_SIGNED_CHAR;
  1584. ***************
  1585. *** 1788,1793 ****
  1586. --- 1821,1836 ----
  1587.       else if (!strcmp (str, "dumpbase"))
  1588.         {
  1589.           dump_base_name = argv[++i];
  1590. + #ifdef atarist
  1591. + /* dump_base_name will typically be 'foo.c' here.  Need to truncate at the '.',
  1592. +    cause dots mean something here */
  1593. +         {
  1594. +           char * n = dump_base_name;
  1595. +           for ( ; ((*n) && (*n != '.')) ; )
  1596. +         n++;
  1597. +           *n = '\0';
  1598. +         }
  1599. + #endif
  1600.         }
  1601.       else if (str[0] == 'd')
  1602.         {
  1603. ***************
  1604. *** 1990,1995 ****
  1605. --- 2033,2039 ----
  1606.   
  1607.     compile_file (filename);
  1608.   
  1609. + #if (!(defined(atarist) || defined(atariminix)))
  1610.   #ifndef USG
  1611.   #ifndef VMS
  1612.     if (print_mem_flag)
  1613. ***************
  1614. *** 2005,2011 ****
  1615.       }
  1616.   #endif /* not VMS */
  1617.   #endif /* not USG */
  1618.     if (errorcount)
  1619.       exit (FATAL_EXIT_CODE);
  1620.     if (sorrycount)
  1621. --- 2049,2055 ----
  1622.       }
  1623.   #endif /* not VMS */
  1624.   #endif /* not USG */
  1625. ! #endif /* atarist or atariminix */
  1626.     if (errorcount)
  1627.       exit (FATAL_EXIT_CODE);
  1628.     if (sorrycount)
  1629.